from flask_restplus import Namespace, fields


def user_login(ns):
    user_md = ns.model(
        "User_query",
        {
            "username": fields.String(description="用户名", max_length=64, required=True),
            "password": fields.String(required=True, max_length=64),
        },
    )
    return user_md


def user_id(ns):
    user_md = ns.model(
        "User_id",
        {
            "id": fields.Integer(description="用户ID"),
        },
    )
    return user_md


def post_hello_mds(ns, hello_md):
    hello_md_post = ns.model(
        "Hello", {"total": fields.Integer(), "data": fields.List(fields.Nested(hello_md))}
    )
    return hello_md_post
